#!/bin/bash
#pwsswd file is 600
SRC_DIR=/home/ts/gitee/collector/rsync/
DEST_HOST=imch@192.168.1.94:
DEST_DIR=ftpdata

inotifywait -m -r -e modify,move,create,delete $SRC_DIR |
while read path action file; do
  rsync -avz --partial --password-file=/home/ts/gitee/collector/script/rsyncd.passwd $SRC_DIR $DEST_HOST:$DEST_DIR
done
